<%@ page language="java" session="false" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!doctype html>
<html lang="es">

    <head>
        <meta charset="utf-8"/>
        <meta name="_csrf" content="${_csrf.token}" />
        <meta name="_csrf_header" content="${_csrf.headerName}" />
        <title>Panel Administrador</title>

        <link rel="stylesheet" href="../css/layout.css" type="text/css" media="screen" />
        <!--[if lt IE 9]>
        <link rel="stylesheet" href="css/ie.css" type="text/css" media="screen" />
        <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
        <script src="../js/jquery.min.js" type="text/javascript"></script>
        <script src="../js/hideshow.js" type="text/javascript"></script>
        <script src="../js/jquery.tablesorter.min.js" type="text/javascript"></script>
        <script type="text/javascript" src="../js/jquery.equalHeight.js"></script>
        <script src="http://ckeditor.com/ckeditor_4.3_beta/ckeditor.js"></script>
        <script src="http://ckeditor.com/ckeditor_4.3_beta/adapters/jquery.js"></script>
        <script type="text/javascript" src="../js/admin.js"></script>
        <script type="text/javascript">
            $(document).ready(function ()
            {
                $(".tablesorter").tablesorter();
            }
            );
            $(document).ready(function () {

                //When page loads...
                $(".tab_content").hide(); //Hide all content
                $("ul.tabs li:first").addClass("active").show(); //Activate first tab
                $(".tab_content:first").show(); //Show first tab content

                //On Click Event
                $("ul.tabs li").click(function () {

                    $("ul.tabs li").removeClass("active"); //Remove any "active" class
                    $(this).addClass("active"); //Add "active" class to selected tab
                    $(".tab_content").hide(); //Hide all tab content

                    var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
                    $(activeTab).fadeIn(); //Fade in the active ID content
                    return false;
                });

            });
        </script>
        <script type="text/javascript">
            $(function () {
                $('.column').equalHeight();
            });
        </script>
    </head>

    <body>

        <header id="header">
            <hgroup>
                <h1 class="site_title"><a href="../">Ir Pagina Minam</a></h1>
            </hgroup>
        </header>

        <section id="secondary_bar">
            <div class="user">
                <p>Administrador</p>

                <sec:authorize access="isAuthenticated()">
                    <c:if test="${pageContext.request.userPrincipal.name != null}">
                        <a class="logout_user" href="javascript:formSubmit();" title="Salir">Salir</a>
                        <form action="../j_spring_security_logout" method="post" id="logoutForm" style="display: none;">
                            <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" />
                        </form>
                        <script>
                            function formSubmit() {
                                document.getElementById("logoutForm").submit();
                            }
                        </script>
                    </c:if>
                </sec:authorize>
            </div>
        </section>

        <aside id="sidebar" class="column">
            <hr/>
            <h3>Noticias</h3>
            <ul class="toggle">
                <li class="icn_new_article"><a class="nueva_noticia" href="#">Nueva Noticia</a></li>
                <li class="icn_edit_article"><a href="#">Editar Noticia</a></li>
                <li class="icn_categories"><a class="lista_noticia" href="#">Noticias</a></li>
            </ul>
            <footer>
                <hr />
                <p><strong>Copyright &copy; 2014 wjma90</strong></p>
                <p>Tema de <a href="#">Willian</a></p>
            </footer>
        </aside><!-- end of sidebar -->

        <section id="main" class="column">

            <!-- <h4 class="alert_info">Bienvenido</h4> -->

            <article id="listaNoticias" class="module width_full">
                <header><h3 class="tabs_involved">Lista de Noticias</h3>
                    <ul class="tabs">
                        <li><a href="#tab1"><</a></li>
                        <li><a href="#tab2">></a></li>
                    </ul>
                </header>

                <div class="tab_container">
                    <div id="tab1" class="tab_content">
                        <table class="tablesorter" cellspacing="0"> 
                            <thead> 
                                <tr> 
                                    <th></th> 
                                    <th>Entry Name</th> 
                                    <th>Category</th> 
                                    <th>Created On</th> 
                                    <th>Actions</th> 
                                </tr> 
                            </thead> 
                            <tbody> 
                                <tr> 
                                    <td><input type="checkbox"></td> 
                                    <td>Lorem Ipsum Dolor Sit Amet</td> 
                                    <td>Articles</td> 
                                    <td>5th April 2011</td> 
                                    <td><input type="image" src="../images/icn_edit.png" title="Edit"><input type="image" src="../images/icn_trash.png" title="Trash"></td> 
                                </tr> 
                                <tr> 
                                    <td><input type="checkbox"></td> 
                                    <td>Ipsum Lorem Dolor Sit Amet</td> 
                                    <td>Freebies</td> 
                                    <td>6th April 2011</td> 
                                    <td><input type="image" src="../images/icn_edit.png" title="Edit"><input type="image" src="../images/icn_trash.png" title="Trash"></td> 
                                </tr>
                                <tr> 
                                    <td><input type="checkbox"></td> 
                                    <td>Sit Amet Dolor Ipsum</td> 
                                    <td>Tutorials</td> 
                                    <td>10th April 2011</td> 
                                    <td><input type="image" src="../images/icn_edit.png" title="Edit"><input type="image" src="../images/icn_trash.png" title="Trash"></td> 
                                </tr> 
                                <tr> 
                                    <td><input type="checkbox"></td> 
                                    <td>Dolor Lorem Amet</td> 
                                    <td>Articles</td> 
                                    <td>16th April 2011</td> 
                                    <td><input type="image" src="../images/icn_edit.png" title="Edit"><input type="image" src="../images/icn_trash.png" title="Trash"></td> 
                                </tr>
                                <tr> 
                                    <td><input type="checkbox"></td> 
                                    <td>Dolor Lorem Amet</td> 
                                    <td>Articles</td> 
                                    <td>16th April 2011</td> 
                                    <td><input type="image" src="../images/icn_edit.png" title="Edit"><input type="image" src="../images/icn_trash.png" title="Trash"></td> 
                                </tr>  
                            </tbody> 
                        </table>
                    </div><!-- end of #tab1 -->

                    <div id="tab2" class="tab_content">
                        <table class="tablesorter" cellspacing="0"> 
                            <thead> 
                                <tr> 
                                    <th></th> 
                                    <th>Comment</th> 
                                    <th>Posted by</th> 
                                    <th>Posted On</th> 
                                    <th>Actions</th> 
                                </tr> 
                            </thead> 
                            <tbody> 
                                <tr> 
                                    <td><input type="checkbox"></td> 
                                    <td>Lorem Ipsum Dolor Sit Amet</td> 
                                    <td>Mark Corrigan</td> 
                                    <td>5th April 2011</td> 
                                    <td><input type="image" src="../images/icn_edit.png" title="Edit"><input type="image" src="../images/icn_trash.png" title="Trash"></td> 
                                </tr> 
                                <tr> 
                                    <td><input type="checkbox"></td> 
                                    <td>Ipsum Lorem Dolor Sit Amet</td> 
                                    <td>Jeremy Usbourne</td> 
                                    <td>6th April 2011</td> 
                                    <td><input type="image" src="../images/icn_edit.png" title="Edit"><input type="image" src="../images/icn_trash.png" title="Trash"></td> 
                                </tr>
                                <tr> 
                                    <td><input type="checkbox"></td> 
                                    <td>Sit Amet Dolor Ipsum</td> 
                                    <td>Super Hans</td> 
                                    <td>10th April 2011</td> 
                                    <td><input type="image" src="../images/icn_edit.png" title="Edit"><input type="image" src="../images/icn_trash.png" title="Trash"></td> 
                                </tr> 
                                <tr> 
                                    <td><input type="checkbox"></td> 
                                    <td>Dolor Lorem Amet</td> 
                                    <td>Alan Johnson</td> 
                                    <td>16th April 2011</td> 
                                    <td><input type="image" src="../images/icn_edit.png" title="Edit"><input type="image" src="../images/icn_trash.png" title="Trash"></td> 
                                </tr> 
                                <tr> 
                                    <td><input type="checkbox"></td> 
                                    <td>Dolor Lorem Amet</td> 
                                    <td>Dobby</td> 
                                    <td>16th April 2011</td> 
                                    <td><input type="image" src="../images/icn_edit.png" title="Edit"><input type="image" src="../images/icn_trash.png" title="Trash"></td> 
                                </tr> 
                            </tbody> 
                        </table>

                    </div><!-- end of #tab2 -->

                </div><!-- end of .tab_container -->

            </article><!-- end of content manager article -->

            <div class="clear"></div>

            <article id="formNoticias" class="module width_full" style="display:none;">
                <header><h3>Post Nueva Noticia</h3></header>
                <div class="module_content">
                    <fieldset>
                        <label>T&iacute;tulo</label>
                        <input type="text" id="titulo">
                    </fieldset>
                    <fieldset>
                        <label>Link de enlace</label>
                        <input type="text" id="enlace">
                    </fieldset>
                    <fieldset>
                        <textarea id="contenido" rows="12"></textarea>
                    </fieldset>
                    <fieldset style="width:48%; float:left; margin-right: 3%;">
                        <label>Imagen</label>
                        <input type="file" id="file" name="file" />
                    </fieldset>
                    <div class="clear"></div>
                </div>
                <footer>
                    <div class="submit_link">
                        <!-- <select>
                            <option>Draft</option>
                            <option>Published</option>
                        </select> -->
                        <input id="registrar" type="button" value="Registrar" class="alt_btn">
                        <input type="button" value="Limpiar">
                    </div>
                </footer>
            </article>
            <div class="spacer"></div>
        </section>
    </body>
</html>